package com.hyt.it.ogt.pj.enums;

import lombok.Getter;


/**
 *
 * 题型级别枚举
 * @author huw
 */
@Getter
public enum PaperItemLevelEnum {

    TOPIC(0, "大题"),
    SUB_ITEM(1, "小题"),
    OPTION(2, "选项"),
    ;

    private Integer level;
    private String desc;

    PaperItemLevelEnum(Integer level, String desc) {
        this.level = level;
        this.desc = desc;
    }
    
    public static PaperItemLevelEnum getEnumByLevel(Integer level){
        for (PaperItemLevelEnum value : values()) {
            if (value.getLevel().equals(level)) {
                return value;
            }
        }
        return null;

    }

    public static String getDescByLevel(Integer level){
        for (PaperItemLevelEnum value : values()) {
            if (value.getLevel().equals(level)) {
                return value.getDesc();
            }
        }
        return null;
    }
}
